package main

import (
	"fmt"
)

type Person struct {
	Name    string
	Age     uint8
	Address Addr
}

type Addr struct {
	City     string
	District string
}

/**
 * 发送到通道的数据是拷贝的值
 * @return {[type]} [description]
 */
func main() {
	personChen := make(chan Person, 1)
	p1 := Person{"xiaoming", 28, Addr{"shenzhen", "guangdong"}}

	fmt.Printf("P1(1)%v\n", p1)
	personChen <- p1

	p1.Name = "xiaohong"
	p1.Address.City = "guangzhou"

	fmt.Printf("p2(2)%v\n", p1)

	p1_copy := <-personChen
	fmt.Printf("p1_copy(1)%v\n", p1_copy)

}
